package com.neutech.terrain;

import com.neutech.Util.ImageUtils;
import com.neutech.base.Drawable;
import com.neutech.base.Sprite;

import java.awt.*;

public class Ice extends Sprite implements Drawable {
    private transient Image image;

    public Ice(int x, int y, int width, int height) {
        super(x, y, width, height);

        loadingImg();
    }

    @Override
    public void draw(Graphics g) {
        if (image == null ){
            loadingImg();
        }
    g.drawImage(image,getX(),getY(),null);

    }

    @Override
    public Rectangle getRectangle() {
        return new Rectangle(getX(),getY(),getWidth(),getHeight());
    }

    public void loadingImg(){
    image = ImageUtils.getValue("ice");
    }
}
